import random
pwin = 0
cwin = 0
option = ['石头', '剪刀', '布']
win = [['石头', '剪刀'], ['剪刀', '布'], ['布', '石头']]
prompt = '''(0)石头
(1)剪刀
(2)布
请出拳(0/1/2):'''

while pwin < 2 and cwin < 2:
    computer = random.choice(option)
    i = int(input(prompt))   #获取下标
    player = option[i]
    print('你出的：%s, 计算机出的%s' % (player, computer))
    if player == computer:
        print(player,computer); print('\033[32;1m平局\033[0m')
    elif  [player, computer] in win:
       print('\033[31;1mYou Win!!!\033[0m')
       pwin += 1
    else:
        print('\033[31;1mYou Lose\033[0m')
        cwin += 1
